<template>
  <div>
    <ul class="catagtory">
      <li @click="$store.commit('category/updatecurrentCategory',item.id)"
      :class="{select:currentCategory === item.id}"
      v-for="item in category" :key="item.id">{{item.name}}</li>
    </ul>
  </div>
</template>

<script>
import { mapGetters } from 'vuex'
export default {
  computed: {
    ...mapGetters(['category', 'currentCategory'])
  },
  created () {
    this.$store.dispatch('category/getCategory')
  }
}
</script>
<style>
</style>
